package com.luguangtao.web;

import com.luguangtao.api.TestApi;
import com.netflix.hystrix.contrib.javanica.annotation.HystrixCommand;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class Test041Controller {
    @Autowired
    private TestApi testApi;


    @RequestMapping("test02")
    //@HystrixCommand(fallbackMethod = "testBack")
    public String test(){

        String s = testApi.test01();
        if(s.equals("出错啦")){
            return "熔断检测---->出错啦";
        }
        return s;
    }

    /*public String testBack(String name){
        return "出错了--参数-->"+name;
    }*/
}
